feat: add binding for flag evaluation#6456
Open
roerohan wants to merge 6 commits intocloudflare:mainfrom
Open
Conversation
Add a new wrapped binding for feature flags, following the same pattern as the AI binding. Includes the public module (cloudflare:flags), internal implementation (cloudflare-internal:flags-api), type definitions, updated type snapshots, and tests with a mock service.
|
All contributors have signed the CLA ✍️ ✅ |
danlapid
requested changes
Mar 30, 2026
Collaborator
danlapid
left a comment
There was a problem hiding this comment.
Hey, thanks for your contribution, but,
- We're not doing any more new wrapped bindings, only full JSRPC bindings are permitted as per the guide in the internal wiki.
- I have not reviewed any SPEC/design doc on the new binding, please send those over at your earliest convenience.
Merging this PR will degrade performance by 12.99%
Performance Changes
Comparing Footnotes
|
…tract Switch from HTTP fetch to JSRPC, aligning with the real FlagshipBinding entrypoint (evaluate(flagKey, context?)). Add EvaluationContext parameter to all public methods for targeting rules. Update mock to extend WorkerEntrypoint, regenerate type snapshots.
5 tasks
danlapid
reviewed
Mar 31, 2026
…nitions The Flags binding is a JSRPC binding handled by the control plane. Only types/defines/flags.d.ts and the generated snapshots are needed in workerd. Remove src/cloudflare/flags.ts, internal/flags-api.ts, and all test files.
Member
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new wrapped binding for flags. Includes the public module, internal implementation, type definitions, updated type snapshots, and tests with a mock service.